package com.dzu.easy;

/**
 * @author ZhaoDong
 * @date 2022/11/9 18:14
 * @description 263. 丑数
 */
public class Test263 {
    public static void main(String[] args) {
        System.out.println(isUgly(7));
    }
    public static boolean isUgly(int n) {

        if (n < 1) {
            return false;
        }
        while (n % 2 == 0) {
            n /= 2;
        }
        while (n % 3 == 0) {
            n /= 3;
        }
        while (n % 5 == 0) {
            n /= 5;
        }
        return n == 1;

    }
}
